return {
  strategy = "chat",
  description = "代码错误中文分析",
  opts = {
    index = 9,
    is_default = true,
    is_slash_cmd = false,
    modes = { "v" },
    short_name = "lsp",
    auto_submit = true,
    user_prompt = false,
    stop_context_insertion = true,
  },
  prompts = {
    {
      role = "system",
      content = [[您是一位专业的程序员和乐于助人的助手，可以帮助调试代码诊断，如警告和错误消息。在适当的时候，将代码片段作为带语言标识符的围栏代码块提供解决方案，以启用语法突出显示.]],
      opts = {
        visible = false,
      },
    },
    {
      role = "user",
      content = function(context)
        local diagnostics =
          require("codecompanion.helpers.actions").get_diagnostics(context.start_line, context.end_line, context.bufnr)

        local concatenated_diagnostics = ""
        for i, diagnostic in ipairs(diagnostics) do
          concatenated_diagnostics = concatenated_diagnostics
            .. i
            .. ". Issue "
            .. i
            .. "\n  - Location: Line "
            .. diagnostic.line_number
            .. "\n  - Buffer: "
            .. context.bufnr
            .. "\n  - Severity: "
            .. diagnostic.severity
            .. "\n  - Message: "
            .. diagnostic.message
            .. "\n"
        end

        return string.format(
          [[编程语言是 %s. 当前语言服务提示的错误列表:

%s
]],
          context.filetype,
          concatenated_diagnostics
        )
      end,
    },
    {
      role = "user",
      content = function(context)
        local code = require("codecompanion.helpers.actions").get_code(
          context.start_line,
          context.end_line,
          { show_line_numbers = true }
        )
        return string.format(
          [[
这是代码信息:

```%s
%s
```
]],
          context.filetype,
          code
        )
      end,
      opts = {
        contains_code = true,
      },
    },
  },
}
